package com.sgb.kjwl.model.entity.map;

import android.os.Parcel;
import android.os.Parcelable;

import com.sgb.kjwl.model.entity.transport.CargoPublishEntity;
import com.sgb.kjwl.model.entity.transport.GoodsInfoTypeEntity3;

import java.util.List;

/**
 * Describe:
 * Author:
 * Date:    2021/8/13
 */
public class CargoMapEntity implements Parcelable{
    private String no;//货源no
    private CargoPublishEntity.LocationEntity sendLocation;//发货地址
    private CargoPublishEntity.LocationEntity destLocation;//收货地址
    private List<GoodsInfoTypeEntity3> carTypeList;//选中车长列表
    private List<GoodsInfoTypeEntity3> carLenList;//选中车型列表

    public CargoMapEntity() {
    }

    protected CargoMapEntity(Parcel in) {
        no = in.readString();
        sendLocation = in.readParcelable(CargoPublishEntity.LocationEntity.class.getClassLoader());
        destLocation = in.readParcelable(CargoPublishEntity.LocationEntity.class.getClassLoader());
        carTypeList = in.createTypedArrayList(GoodsInfoTypeEntity3.CREATOR);
        carLenList = in.createTypedArrayList(GoodsInfoTypeEntity3.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(no);
        dest.writeParcelable(sendLocation, flags);
        dest.writeParcelable(destLocation, flags);
        dest.writeTypedList(carTypeList);
        dest.writeTypedList(carLenList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Parcelable.Creator<CargoMapEntity> CREATOR = new Parcelable.Creator<CargoMapEntity>() {
        @Override
        public CargoMapEntity createFromParcel(Parcel in) {
            return new CargoMapEntity(in);
        }

        @Override
        public CargoMapEntity[] newArray(int size) {
            return new CargoMapEntity[size];
        }
    };

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public CargoPublishEntity.LocationEntity getSendLocation() {
        return sendLocation;
    }

    public void setSendLocation(CargoPublishEntity.LocationEntity sendLocation) {
        this.sendLocation = sendLocation;
    }

    public CargoPublishEntity.LocationEntity getDestLocation() {
        return destLocation;
    }

    public void setDestLocation(CargoPublishEntity.LocationEntity destLocation) {
        this.destLocation = destLocation;
    }

    public List<GoodsInfoTypeEntity3> getCarTypeList() {
        return carTypeList;
    }

    public void setCarTypeList(List<GoodsInfoTypeEntity3> carTypeList) {
        this.carTypeList = carTypeList;
    }

    public List<GoodsInfoTypeEntity3> getCarLenList() {
        return carLenList;
    }

    public void setCarLenList(List<GoodsInfoTypeEntity3> carLenList) {
        this.carLenList = carLenList;
    }
}
